package com.moleq.models;

import com.moleq.db.DatabaseSchema;

public class FlipChart {

	// CREATE TABLE t_flip_chart
	// (fc_id integer NOT NULL,
	// F01 varchar(20) NOT NULL,
	// fc_group integer NOT NULL,
	// fc_order integer NOT NULL,
	// create_datetime varchar(14) NULL,
	// update_datetime varchar(14) NULL,
	// PRIMARY KEY (fc_id));

	private int id;
	private String upc;
	private int group;
	private int order;
	private String createTime;
	private String updateTime;
	private String name;
	private int isDelete;
	private int nOrder;

	public FlipChart() {
	}

	public FlipChart(int id, String upc, int group, int order,
			String createTime, String updateTime, String name) {
		this.id = id;
		this.upc = upc;
		this.group = group;
		this.order = order;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.setName(name);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUpc() {
		return upc;
	}

	public void setUpc(String upc) {
		this.upc = upc;
	}

	public int getGroup() {
		return group;
	}

	public void setGroup(int group) {
		this.group = group;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(int isDelete) {
		this.isDelete = isDelete;
	}

	public int getnOrder() {
		return nOrder;
	}

	public void setnOrder(int nOrder) {
		this.nOrder = nOrder;
	}

	public String toMGData(String Action) {
		String Result = Action + "|" + DatabaseSchema.FlipChart.SCHEMA_NAME
				+ "|(" + getId() + "," + CheckNull(getUpc()) + "," + getGroup()
				+ "," + getOrder() + "," + CheckNull(getCreateTime()) + ","
				+ CheckNull(getUpdateTime()) + ")";
		return Result;
	}

	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}
}
